erDiagram
    USER ||--o{ HOSTEL_INFO : "owns"
    USER ||--o{ PARK_INFO : "owns"
    USER ||--o{ UPKEEP_INFO : "reports"
    USER ||--o{ UPKEEP_INFO : "handles"
    USER ||--o{ COST_INFO : "pays"
    USER ||--o{ NOTICE_INFO : "publishes"
    USER ||--o{ OPERATE_LOG : "performs"
    
    HOSTEL_INFO }|--|| BUILD_INFO : "belongs_to"
    HOSTEL_INFO ||--o{ UPKEEP_INFO : "has"
    HOSTEL_INFO ||--o{ COST_INFO : "generates"
    
    BUILD_INFO ||--o{ HOSTEL_INFO : "contains"
    
    USER {
        char id PK "20"
        varchar username "55"
        varchar password "155"
        varchar email "55"
        varchar avatar "255"
        int sex "0"
        int position "0"
        varchar hostel_id "55"
        datetime create_time
        datetime update_time
        int is_delete
    }
    
    HOSTEL_INFO {
        char id PK "20"
        varchar hostel_code "255"
        char user_id FK "20"
        char build_id FK "20"
        datetime create_time
        datetime update_time
        int is_delete
        int status
        double area "10,2"
    }
    
    BUILD_INFO {
        varchar id PK "50"
        varchar building_name "255"
        varchar location "255"
        double usable_area
        int room_number
        int layers_number
        datetime create_time
        datetime update_time
        int is_delete
    }
    
    PARK_INFO {
        char id PK "50"
        char user_id FK "50"
        varchar parking_number "200"
        varchar location "255"
        int status
        int is_delete
        datetime create_time
        datetime update_time
    }
    
    UPKEEP_INFO {
        char id PK "50"
        varchar title "255"
        varchar description "255"
        char hostel_id FK "50"
        char reporter_id FK "50"
        datetime create_time
        datetime update_time
        int status
        varchar prebook_start_time "50"
        varchar prebook_end_time "50"
        varchar reporter_image "255"
        char upkeep_id FK "50"
        varchar upkeep_image "255"
        double price "10,2"
        int pay_way
        varchar remark "255"
        int is_delete
    }
    
    COST_INFO {
        char id PK "50"
        char user_id FK "50"
        char hostel_id FK "20"
        varchar type "255"
        double price "10,2"
        int pay_number
        varchar remark "255"
        int is_delete
        int status
        datetime create_time
        datetime update_time
        varchar month "255"
    }
    
    NOTICE_INFO {
        varchar id PK "50"
        varchar title "255"
        text content
        varchar publish_user_id FK "50"
        int status
        varchar receiver_ids "255"
        datetime publish_time
        datetime create_time
        datetime update_time
        int is_delete
    }
    
    OPERATE_LOG {
        varchar id PK "50"
        varchar user_id FK "255"
        varchar request_way "10"
        varchar url "255"
        varchar name "255"
        varchar login_ip "255"
        datetime create_time
        datetime update_time
    }